/*
 *  Copyright 2007 Blandware (http://www.blandware.com)
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.blandware.atleap.webapp.struts;

import java.util.ArrayList;

/**
 * <p>Represents a list which may be a container.</p>
 * <p>Needed as a replacement to {@link java.util.List} because definition
 * attributes-lists are represented with List, but we need a
 * {@link com.blandware.atleap.webapp.struts.PossibleContainer} instance here.</p>
 * <p><a href="ContainerList.java.html"><i>View source</i></a></p>
 *
 * @author Roman Puchkovskiy <a href="mailto:roman.puchkovskiy@blandware.com">
 *         &lt;roman.puchkovskiy@blandware.com&gt;</a>
 * @version $Revision: 1.2 $ $Date: 2007/04/09 14:06:44 $
 */
public class ContainerList extends ArrayList implements PossibleContainer {
    /**
     * Whether this is a container (i.e. can contain components)
     */
    protected boolean container;

    /**
     * Description
     */
    protected String description;

    /**
     * Default constructor.
     */
    public ContainerList() {
    }

    /**
     * Copy constructor - does a shallow copy.
     *
     * @param l - what to copy
     */
    public ContainerList(ContainerList l) {
        super(l);
        setContainer(l.isContainer());
        setDescription(l.getDescription());
    }

    /**
     * Returns whether this is a container.
     *
     * @return true if this is a container
     */
    public boolean isContainer() {
        return container;
    }

    /**
     * Sets whether this is a container.
     *
     * @param container value to set
     */
    public void setContainer(boolean container) {
        this.container = container;
    }

    /**
     * Returns description.
     *
     * @return description
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets description.
     *
     * @param description description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }
}
